<?php
use Webman\Route;
Route::group('/admin', function () {
    Route::get('/logout', [app\user\controller\UserController::class, 'logout']);           // 退出登陆
    Route::get('/off', [app\user\controller\UserController::class, 'writeOff']);            // 注销用户
    Route::post('/edit', [app\user\controller\UserController::class, 'editInfo']);          // 编辑信息
})->middleware([
    \app\middleware\CheckAdminLogin::class,
]);

Route::group('/admin', function (){
    Route::post('/register', [app\user\controller\UserController::class, 'register']);      // 注册
    Route::post('/login', [app\user\controller\UserController::class, 'login']);         // 登陆
    Route::get('/code', [app\user\controller\UserController::class, 'sendCode']);           // 发送验证码
});

Route::group('/search_advert', function (){
    Route::get('/add', [app\user\controller\UserController::class, 'add']);      // 注册     // 发送验证码
    Route::options('/add', [app\user\controller\UserController::class, 'add']);      // 注册     // 发送验证码
});